package sdmaker.ast;

import java.util.List;

import sdmaker.parser.Utils;

public class ASTsequence implements AST {
	private List<AST> sequence;
	
	
	/* ************************ *
	 * ***** CONSTRUCTORS ***** *
	 * ************************ */
	
	public ASTsequence(List<AST> sequence){
		this.sequence= sequence;
	}
	
	

	/* ************************ *
	 * ******** OTHERS ******** *
	 * ************************ */

	public String toString(){
		String result="";
		
		for(int i= 0; i < (sequence.size()-1); i++){
			result+=sequence.get(i)+"\n";
		}
		
		if(sequence.size() > 0){
			result+=Utils.getLast(sequence);
		}
		
		return result;
	}
}
